package refresh;

import team02.server.bean.OrganizationBean;

import java.util.Timer;
import java.util.TimerTask;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

class AutoTask extends TimerTask {
	AutoTask() {
	}

	public void run() {
		OrganizationBean org=new OrganizationBean();
		org.refresh();
	}

}

public class refresh implements ServletContextListener {
	ServletContext context;

	public void contextInitialized(ServletContextEvent contextEvent) {
		AutoTask myTask = new AutoTask();
		Timer bkTimer = new Timer();
		bkTimer.schedule(myTask, 1000 * 60, 10000);
	}

	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		// TODO Auto-generated method stub

	}
}